<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="content">流氓广告</div>
    <button>按钮</button>
                <!-- ​3 实现流氓广告的关闭

            显示一个流氓广告框，点击关闭后 4秒钟后继续显示出来  -->
            <script>
                    var div = document.getElementsByClassName("content")[0];
                    var but = document.getElementsByTagName("button")[0];
                    but.onclick = function(){
                        div.style.display = "none";
                        setInterval(function(){
                            div.style.display="block"
                        },4000)
                    }
            </script>
</body>
</html>